package com.example.demo.t2;

import java.util.*;

public class Temp<T> implements Iterable<T> {

    private Random random = new Random();
    private List<T> list;
    public Temp(List<T> _list) {
        this.list = _list;
    }

    @Override
    public Iterator<T> iterator() {
        return new Iterator<T>() {
            @Override
            public boolean hasNext() {


                return true;
            }

            @Override
            public T next() {
                return list.get(random.nextInt(list.size()));
            }
        };
    }
}
